package cn.netjava.manageraction;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import cn.netjava.actioninterface.Action;
import cn.netjava.dao.ArticleDao;
import cn.netjava.pojo.Article;
/**
 * this action is use for dealing with article manager
 * @author Administrator
 *
 */
public class ManagerArticleAction implements Action{

	public String excute(HttpServletRequest request,
			HttpServletResponse response) {
		
		HttpSession session =request.getSession();
		
	    /*to get all articles by ArticleDao object,then put it to session*/
		ArticleDao adao = ArticleDao.getArticleDao();
		List<Article> articleList = adao.getAllArticleFromSQL();
		session.setAttribute("allarticle", articleList);
		
		return "JSP/managerjsp/managerarticle.jsp";
	}

}
